<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setAttribute("path", request.getContextPath());
%>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>赤焰信息小程序管理系统 - 基本表单</title>
    <meta name="keywords" content="赤焰信息小程序管理系统">
    <meta name="description" content="赤焰信息小程序管理系统">

    <link rel="shortcut icon" href="favicon.ico"> <link href="${path}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${path}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${path}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${path}/css/animate.min.css" rel="stylesheet">
    <link href="${path}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">

<div class="col-sm-12">
<div class="ibox float-e-margins">
    <div class="ibox-title">
        
        <div class="ibox-tools" >
             <button class="btn btn-white"  data-dismiss="modal"><i class="fa fa-times"></i></button>
        </div>
    </div>
    <div class="ibox-content">
        <form method="post" class="form-horizontal" action="/pc/${lowercaseBean}/toView.do" id="form-area">
        
        	<input type="hidden" id="" name="${seqId!"seqId"}" value="${seqIdValue!""}"/>
        	<#list fields?keys as field>
	        	<#list captions?keys as caption>
	        		<#if field==caption>
			            <div class="form-group">
			                <label class="col-sm-2 control-label">${captions[caption]!("null")}</label>
			                <div class="col-sm-10">
			                    <input type="text" value="${fields[field]!("null")}" name="${field }"  class="form-control"  readonly="readonly">
			                </div>
			            </div>
			        </#if> 
	            </#list>
             </#list>
             
            <div class="hr-line-dashed"></div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    <button class="btn btn-white"  data-dismiss="modal">关闭</button>
                </div>
            </div>
        </form>
    </div>
</div>



</body>
<script type="text/javascript">
	
</script>


<script src="${path}/js/jquery.min.js?v=2.1.4"></script>
<script src="${path}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${path}/js/content.min.js?v=1.0.0"></script>
<script src="${path}/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})
    
    var form = $('#form-area');
	$('#form-area').submit(function(){
		$.ajax({
            url: '/pc/${lowercaseBean}/toView.do',
            async: false,//同步，会阻塞操作
            type: 'POST',//PUT DELETE POST
            data: form.serialize(),
            dataType:'json',
            success: function (result) {
                console.log(result);
                if (result.code=="0") {
                	window.location.reload();//刷新当前页面
                	//$("#addModal").modal('hide');
                	alert(result.msg);
                	return true;
                } else {
                	alert(result.msg);
                	return false;
                }
            }, error: function () {
                alert("失败");
                return false;
            }
        })	
        return false;
	});
    
    });
</script>

</html>
